package com.tfy.liquor.dao;

import com.tfy.liquor.bean.ProductInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Service;

/**
 * 产品图文详情信息
 */
@Mapper
@Service
public interface ProductDetailDao {
    // 添加产品图文信息
    @Insert("insert into product_detail values(null, '${productId}', '${details}')")
    int addProductDetail(ProductInfo productInfo);

    // 修改产品图文信息
    @Update("update product_detail set details='${details}' where productId = ${productId}")
    int editProductDetail(ProductInfo productInfo);

    // 根据产品编号获取产品图文信息
    @Select("select details from product_detail where productId='${productId}'")
    String getProductDetail(String ProductId);
}
